package com.yhg.Test;

import com.yhg.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

//ApplicationContext快速入门
//懒汉式 单例模式

public class ApplicationContextTest {
    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        UserService userService = (UserService)  ac.getBean("userService");
        System.out.println(userService);
    }
}

